package com.bkm.factory;

/**
 * 寶可夢構建
 */
public class BaoKeMengBuilder {

    private BaoKeMeng baoKeMeng;

    private BaoKeMengBuilder(String name) {
        baoKeMeng = new BaoKeMeng(name);
    }

    /**
     * 創建寶可夢
     *
     * @param name 寶可夢的名字
     * @return
     */
    public static final BaoKeMengBuilder create(String name) {
        return new BaoKeMengBuilder(name);
    }

    /**
     * 設置出生月份
     *
     * @param type 寶可夢的月份
     * @return
     */
    public BaoKeMengBuilder type(TypeEnum type) {
        this.baoKeMeng.setType(type);
        return this;
    }

    /**
     * 設置個人介紹
     *
     * @param introduce
     * @return
     */
    public BaoKeMengBuilder introduce(String introduce) {
        this.baoKeMeng.setIntroduce(introduce);
        return this;
    }

    /**
     * 設置標簽
     *
     * @param tags
     * @return
     */
    public BaoKeMengBuilder tag(String... tags) {
        for (String tag : tags) {
            this.baoKeMeng.addTags(tag);
        }
        return this;
    }

    /**
     * 返回寶可夢
     *
     * @return
     */
    public BaoKeMeng done() {
        return this.baoKeMeng;
    }
}
